const Koa = require("koa");
// const koaBody=require("koa-body");
const koaviews = require("koa-views")
const koastatic = require("koa-static");
const mongoose = require("mongoose");
let router = require("./router/router.js");
const app = new Koa();
// let db = mongoose.connect("mongdb://127.0.0.1:27017/login/login", function (err) {
//     if (err) {
//         return console.log(err);
//     }
//     console.log("链接成功");
// })
app.use(koaviews(__dirname+"/views"))
app.use(koastatic(__dirname+"/static"))
router.get("/index", ctx=>{
     ctx.render("index.html")
})
router(app);
app.listen(8585);
